import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/login', // 登陆页面
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/login/Login.vue')
    },
    {
      path: '/agreement', // 用户注册协议
      name: 'agreement',
      component: () => import('./views/login/Agreement.vue')
    },
    {
      path: '/listgoods', // 商品列表
      name: 'listgoods',
      component: () => import('./views/goods/ListGoods.vue')
    },
    {
      path: '/goods', // 商品详情
      name: 'goods',
      component: () => import('./views/goods/Goods.vue')
    },
    {
      path: '/cart', // 购物车
      name: 'cart',
      component: () => import('./views/goods/Cart.vue')
    },
    {
      path: '/sureorder', // 购物车
      name: 'sureorder',
      component: () => import('./views/goods/SureOrder.vue')
    },
    {
      path: '/orderdetails', // 购物车
      name: 'orderdetails',
      component: () => import('./views/order/OrderDetails.vue')
    },
    {
      path: '/editaddress', // 添加收货地址编辑
      name: 'editaddress',
      component: () => import('./views/my/EditAddress.vue')
    },
    {
      path: '/addresslist', // 添加收货地址编辑
      name: 'addresslist',
      component: () => import('./views/my/AddressList.vue')
    },
    {
      path: '/comments', // 用户评论列表
      name: 'comments',
      component: () => import('./views/goods/Comments.vue')
    },
    {
      path: '/forget', // 忘记密码
      name: 'forget',
      component: () => import('./views/login/Forget.vue')
    },
    {
      path: '/found', // 我的页面
      name: 'found',
      component: () => import('./views/found/Found.vue')
    },
    {
      path: '/my', // 我的页面
      name: 'my',
      component: () => import('./views/my/My.vue')
    },
    {
      path: '/myorder', // 我的订单
      name: 'myorder',
      component: () => import('./views/order/MyOrder.vue')
    },
    {
      path: '/logistics', // 我的订单
      name: 'logistics',
      component: () => import('./views/order/Logistics.vue')
    },
    {
      path: '/seting', // 设置
      name: 'seting',
      component: () => import('./views/my/Seting.vue')
    },
    {
      path: '/listreal', // 认证页面
      name: 'listreal',
      component: () => import('./views/my/ListReal.vue')
    },
    {
      path: '/real', // 认证页面
      name: 'real',
      component: () => import('./views/my/Real.vue')
    },
    {
      path: '/modifyuser', // 编辑我的资料
      name: 'modifyuser',
      component: () => import('./views/my/ModifyUser.vue')
    },
    {
      path: '/author', // 编辑我的资料
      name: 'author',
      component: () => import('./views/my/Author.vue')
    },
    {
      path: '/changepassword', // 修改密码
      name: 'changepassword',
      component: () => import('./views/my/ChangePassword.vue')
    },
    {
      path: '/message', // 消息
      name: 'message',
      component: () => import('./views/message/Message.vue')
    },
    {
      path: '/stylelist', // 通用样式
      name: 'stylelist',
      component: () => import('./views/StyleList.vue')
    },
    {
      path: '*', // 通配必须排行最后
      name: 'Error',
      component: () => { './views/StyleList.vue' }
    }
  ]
})
